Skip to content

Fix non-deterministic encoding of syntax contexts - #161450

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
aerooneqq:syntax-ctxt-non-deterministic-encoding
Sep 16, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
aerooneqq:syntax-ctxt-non-deterministic-encoding

Conversation

@aerooneqq

@aerooneqq aerooneqq commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

View all comments

Reiteration of #157409. Explanation can be found in comment for encoding_indices and in the issue.

Fixes #129094. Blocked by #161353.

r? @petrochenkov

No llms used.

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 21, 2026
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Aug 21, 2026
@rust-log-analyzer

This comment has been minimized.

@aerooneqq
aerooneqq force-pushed the syntax-ctxt-non-deterministic-encoding branch from b07d315 to 3f750ec Compare August 21, 2026 10:33
@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@aerooneqq
aerooneqq force-pushed the syntax-ctxt-non-deterministic-encoding branch from a34d24f to 3868148 Compare September 2, 2026 08:27
@rustbot

This comment has been minimized.

Comment thread compiler/rustc_span/src/hygiene.rs Outdated
@petrochenkov

Copy link
Copy Markdown
Contributor

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 3, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 3, 2026
…ing, r=<try>

Fix non-deterministic encoding of syntax contexts
@petrochenkov petrochenkov removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 3, 2026
@rust-bors

rust-bors Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 7e01adf (7e01adfdd3209974b2d32d2eb35d4173deaa540b)
Base parent: 4fcf397 (4fcf39725a9c99bd495d8c73af83628a256ff9a9)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (7e01adf): comparison URL.

Overall result: ❌ regressions - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never rustc-perf
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.6% [0.1%, 1.9%] 72
Regressions ❌
(secondary)
0.6% [0.1%, 1.7%] 50
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.6% [0.1%, 1.9%] 72

Max RSS (memory usage)

Results (primary 1.0%, secondary -1.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.0% [1.0%, 1.0%] 1
Regressions ❌
(secondary)
3.7% [2.6%, 4.9%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.7% [-4.6%, -1.4%] 5
All ❌✅ (primary) 1.0% [1.0%, 1.0%] 1

Cycles

Results (primary -0.2%, secondary 4.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.3% [2.3%, 2.3%] 1
Regressions ❌
(secondary)
4.5% [4.5%, 4.5%] 1
Improvements ✅
(primary)
-2.7% [-2.7%, -2.7%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-2.7%, 2.3%] 2

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 476.065s -> 474.462s (-0.34%)
Artifact size: 401.18 MiB -> 401.32 MiB (0.03%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Sep 3, 2026
@petrochenkov petrochenkov added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 3, 2026
@aerooneqq
aerooneqq force-pushed the syntax-ctxt-non-deterministic-encoding branch from 3868148 to 4846400 Compare September 7, 2026 09:48
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (75e938b): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never rustc-perf
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.1% [0.1%, 0.1%] 1
Regressions ❌
(secondary)
0.4% [0.3%, 0.5%] 4
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 1
Improvements ✅
(secondary)
-0.2% [-0.3%, -0.2%] 4
All ❌✅ (primary) -0.0% [-0.2%, 0.1%] 2

Max RSS (memory usage)

Results (primary -1.2%, secondary -1.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.9% [3.0%, 4.9%] 3
Improvements ✅
(primary)
-1.2% [-1.8%, -0.6%] 2
Improvements ✅
(secondary)
-3.9% [-8.1%, -1.6%] 5
All ❌✅ (primary) -1.2% [-1.8%, -0.6%] 2

Cycles

Results (primary -1.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.6% [0.6%, 0.6%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.1% [-3.1%, -3.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.2% [-3.1%, 0.6%] 2

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 498.957s -> 493.438s (-1.11%)
Artifact size: 406.94 MiB -> 406.96 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 14, 2026
@aerooneqq
aerooneqq force-pushed the syntax-ctxt-non-deterministic-encoding branch 2 times, most recently from e6d2012 to a26d7b6 Compare September 15, 2026 11:46
@aerooneqq

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 15, 2026
Comment thread compiler/rustc_span/src/hygiene.rs Outdated
Comment thread compiler/rustc_span/src/hygiene.rs Outdated
@petrochenkov

Copy link
Copy Markdown
Contributor

r=me with the nits addressed.
@bors delegate+
@rustbot author

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 15, 2026
@rust-bors

rust-bors Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

✌️ @aerooneqq, you can now approve this pull request!

If @petrochenkov told you to "r=me" after making some further change, then please make that change and post @bors r=petrochenkov.

View changes since this delegation.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 15, 2026
@rustbot

rustbot commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@aerooneqq
aerooneqq force-pushed the syntax-ctxt-non-deterministic-encoding branch from a26d7b6 to 2e35677 Compare September 15, 2026 14:50
@aerooneqq

Copy link
Copy Markdown
Contributor Author

@bors r=petrochenkov

@rust-bors

rust-bors Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 2e35677 has been approved by petrochenkov

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 15, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors p=6 scheduling

@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 16, 2026
@rust-bors

rust-bors Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: petrochenkov
Duration: 3h 9m 26s
Pushing 2b9a7be to main...

@rust-bors
rust-bors Bot merged commit 2b9a7be into rust-lang:main Sep 16, 2026
14 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor
What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 215a8af (parent) -> 2b9a7be (this PR)

Test differences

Show 22 test diffs

22 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 2b9a7be8551a6497a952d87d7dbf38484e5bfa5a --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. test-x86_64-gnu-gcc-core-tests: 9m 19s -> 17m 48s (+91.1%)
  2. test-x86_64-gnu-llvm-21-3: 1h 26m -> 2h 3m (+42.8%)
  3. test-x86_64-gnu-llvm-21-1: 44m 26s -> 1h 2m (+40.9%)
  4. dist-powerpc64le-linux-musl: 1h 9m -> 1h 36m (+38.3%)
  5. test-x86_64-gnu-nopt: 1h 48m -> 2h 30m (+38.1%)
  6. test-x86_64-gnu-stdlib-semver-check: 11m 18s -> 15m 26s (+36.6%)
  7. test-x86_64-gnu-llvm-21-2: 1h 16m -> 1h 43m (+35.8%)
  8. test-various: 1h 36m -> 2h 10m (+35.8%)
  9. test-pr-check-1: 30m 33s -> 40m 46s (+33.4%)
  10. dist-riscv64-linux-gnu: 1h 32m -> 1h 2m (-32.5%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (2b9a7be): comparison URL.

Overall result: ❌ regressions - please read:

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.5% [0.5%, 0.5%] 1
Regressions ❌
(secondary)
0.5% [0.3%, 0.6%] 8
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.5% [0.5%, 0.5%] 1

Max RSS (memory usage)

Results (primary -1.5%, secondary -2.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.5% [2.1%, 5.5%] 3
Improvements ✅
(primary)
-1.5% [-2.7%, -0.7%] 6
Improvements ✅
(secondary)
-5.5% [-8.3%, -2.1%] 5
All ❌✅ (primary) -1.5% [-2.7%, -0.7%] 6

Cycles

Results (primary -3.0%, secondary 5.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
5.9% [5.9%, 5.9%] 1
Improvements ✅
(primary)
-3.0% [-3.0%, -3.0%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -3.0% [-3.0%, -3.0%] 1

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 498.703s -> 496.542s (-0.43%)
Artifact size: 406.94 MiB -> 406.87 MiB (-0.02%)

halstead pushed a commit to openembedded/openembedded-core that referenced this pull request Sep 16, 2026
HygieneEncodeContext::encode walks a hash set while it writes the syntax
context and expansion records into the rmeta, so the byte order of the
records follows the iteration order of the set and differs between
builds on the arm workers. The added patch sorts both sets before they
are written.

Upstream tracks this as rust-lang/rust issue 129094 [1] and has fixed
it differently in pull request 161450 [2], merged after 1.99 branched.
That change is too big to backport to 1.98 safely, so carry this small
sort until a rust upgrade contains it.

[1] rust-lang/rust#129094
[2] rust-lang/rust#161450

[YOCTO #16376]

Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org>
Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
pull Bot pushed a commit to pthis/openembedded-core that referenced this pull request Sep 17, 2026
HygieneEncodeContext::encode walks a hash set while it writes the syntax
context and expansion records into the rmeta, so the byte order of the
records follows the iteration order of the set and differs between
builds on the arm workers. The added patch sorts both sets before they
are written.

Upstream tracks this as rust-lang/rust issue 129094 [1] and has fixed
it differently in pull request 161450 [2], merged after 1.99 branched.
That change is too big to backport to 1.98 safely, so carry this small
sort until a rust upgrade contains it.

[1] rust-lang/rust#129094
[2] rust-lang/rust#161450

[YOCTO #16376]

Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org>
Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-run-make Area: port run-make Makefiles to rmake.rs merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

derives: parallel compiler makes builds irreproducible

6 participants